﻿@using SH = EMoney.IStock.Client.Framework.StringHelper;
@using EMoney.IStock.Client.Models.QQ;
@using EMoney.IStock.Client.Framework;
@{
    Layout = null;
    EmRss emrss = (EmRss)ViewBag.EmRss;
    string[] qq = null;
    if (emrss != null)
    {
        qq = emrss.data;
    }

    string color = "default";
    if (ViewBag.Color != null)
    {
        color = ViewBag.Color.ToString();
    }

    string uptime = "";
    if (ViewBag.UpTime != null)
    {
        uptime = ViewBag.UpTime;
        uptime = DateTime.Parse(uptime).ToString("MM-dd HH:mm");
    }

    string scrollbarblock = "scrollbarblock1.gif";
    if( ViewBag.scrollbarblock != null)
    {
        scrollbarblock = ViewBag.scrollbarblock;
    }
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>高手数据</title>
    <link rel="stylesheet" type="text/css" href="@ViewBag.PageCss" id="linkcss" />
    <script src="http://static.emoney.cn/js/libs/jquery.min.1.8.3.js" type="text/javascript"></script>
    <script src="@SH.GetStaticFile("IStockClientStatic/js/istockfunc.js")" type="text/javascript"></script>
    <script src="@SH.GetStaticFile("IStockClientStatic/js/common.js")" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="@ViewBag.ScrollCss" id="linkscrollcss" />
</head>
<body onload="rize()" onresize="rize()">
    <div class="main">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td align="left" valign="top" style="padding-right: 17px;">
                   <div class="main_left">
                    <div class="tab_1 tab_paiming"><a hidefocus="true" id="rank" href="javascript:;" class="on">总排名</a><a hidefocus="true" id="weekrank" href="javascript:;">周排名</a><a hidefocus="true" id="dayrank" href="javascript:;">日排名</a></div>                     
                      <div style="position:absolute; right:6px; top:6px; color:#aaa; font-size:12px;">榜单更新时间：@(uptime)</div>
                        <div class="rank_k" style="position: relative;">
                            <div class="tc_loading">数据加载中...</div>
                            <div class="mask"></div>
                       </div>
                    <div class="rank_ad"></div>
                   </div> 
                </td>
                <td width="273" align="left" valign="top">
                  <div class="main_right">
                    <div class="tab_1"><a class="on">高手聚焦</a></div>
                    <div class="plate_k" id="rank_gsjm_block">
                            
                        @{
                            List<TB_FocusBlock> lst = (List<TB_FocusBlock>)ViewBag.FocusBlock;
                            
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    @{
                                        if(lst !=null && lst.Count> 0)
                                        {
                                            foreach (TB_FocusBlock model in lst)
                                            {
                                                int blockcode = int.Parse(model.BlockCode) + 2000000;
                                                <td align="left" style="cursor:pointer;" onclick="GotoPaiMing('@(blockcode.ToString())')">
                                                    <div class="plate">
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                            <tr>
                                                                <td>@(model.BlockName)</td>
                                                            </tr>
                                                        </table>
                                                    </div>
                                                </td>
                                            }
                                        }
                                     }
                                </tr>
                                
                            </table>
                        }
                    </div>
                    <div class="data_box" style="overflow: hidden;">
                            <div id="scrollBox2" class="scrollBox" scrollflag style="height: 270px;">
                                <div style="padding-right: 10px;">

                                    <div class="data_new">
                                        <h3 class="data_new_title">当日聚焦</h3>
                                        <div id="gsjj_day_lst"></div>
                                        
                                    </div>

                                    <div class="data_new">
                                        <h3>昨日聚焦</h3>
                                        <div id="gsjj_yesterday_lst"></div>
                                    </div>

                                </div>
                            </div>
                     <div class="tab_1_box01">
                        <div class="tab_1 tab_1_title"><a hidefocus="true" id="gscz" href="javascript:;" class="on">高手操作</a><a hidefocus="true" id="wddy" href="javascript:;">我的订阅</a></div>
                        <div class="tab_1_box">
                            <div class="stock_inf" style="position: relative;">
                                <div id="scrollBox3" class="scrollBox" scrollflag style="height: 170px;">
                                    <div id="tabrss_lst">
                                        
                                    </div>
                                </div>
                            </div>
                        </div>
                     </div>  
                    </div>
                  </div>  
                </td>
            </tr>
        </table>
    </div>

    <div id="uncover" class="uncover hide" style="z-index: 20000">
        <div class="uncover_box">
            <h2><span>高手揭秘</span><b class="close">X</b></h2>
            <div id="uncover_left" class="uncover_left">
            </div>
            <!--uncover_right-->
            <div class="uncover_right">
                <ul class="uncover_right_title">
                    <li id="cclst" class="uncover_right_A">持仓列表</li>
                    @*<li id="jydetail">交易明细</li>*@
                </ul>
                <div class="uncover_right_box">
                    <div id="uncover_right_k_cclst" class="uncover_right_k">
                        <div class="uncover_right_top">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <th width="6%" align="center" valign="middle">序号</th>
                                    <th width="11%" align="center" valign="middle">名称</th>
                                    <th width="11%" align="center" valign="middle">
                                        @*<a href="#" class="uncover_right_top_B"></a>*@
                                        代码
                                    </th>
                                    <th width="11%" align="center" valign="middle">最新</th>
                                    <th width="11%" align="center" valign="middle">涨幅</th>
                                    <th width="12%" align="center" valign="middle">持股数</th>
                                    <th width="11%" align="center" valign="middle">成本价</th>
                                    <th width="13%" align="center" valign="middle">持仓市值</th>
                                    <th width="12%" align="center" valign="middle">盈亏比%@*<a href="#" class="uncover_right_top_C"></a>*@</th>
                                </tr>
                            </table>
                        </div>
                        <div class="uncover_right_list" >
                            <div id="scrollBox4" class="scrollBox" scrollflag style="height: 212px;">
                                <div id="gsjmLst" style="position: relative;">
                                    <div class="tc_loading" style="position: static; height: 190px; line-height: 190px; width: 100%; text-align: center;">数据加载中...</div>
                                    <div class="mask"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="uncover_right_k_jydetail" class="uncover_right_k hide">
                        <div class="uncover_right_top">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <th width="8%" align="center" valign="middle">
                                        <img src="@SH.GetStaticFile("IStockClientStatic/qq/images/black_17.jpg")" width="16" height="16" alt="" /></th>
                                    <th width="11%" align="center" valign="middle">名称</th>
                                    <th width="11%" align="center" valign="middle">
                                        @*<a href="#"><img src="@SH.GetStaticFile("IStockClientStatic/qq/images/uncover_img03.jpg")" class="fl" alt="" /></a>*@代码</th>
                                    <th width="11%" align="center" valign="middle">最新</th>
                                    <th width="11%" align="center" valign="middle">涨幅</th>
                                    <th width="12%" align="center" valign="middle">持股数</th>
                                    <th width="11%" align="center" valign="middle">成本价</th>
                                    <th width="13%" align="center" valign="middle">持仓市值</th>
                                    <th width="12%" align="center" valign="middle"><span class="fl">盈亏比</span>@*<a href="#" class="uncover_right_top_C"></a>*@</th>
                                </tr>
                            </table>
                        </div>
                        <div class="uncover_right_list">
                            <div id="scrollBox5" class="scrollBox" scrollflag style="height: 218px;">
                                <div id="gsjmDetailLst" style="position: relative;">
                                    <div class="tc_loading">数据加载中...</div>
                                    <div class="mask"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--uncover_right end-->
        </div>
    </div>
    <!--排名类型-->
    <input id="hid_ranktype" type="hidden" value="rank" />
    <input id="hid_gscztype" type="hidden" value="gscz" />
    <!--被订阅的qq号-->
    <input id="hid_ruid" type="hidden" value="" />
    <input id="SortFlag" type="hidden" value="" />
    <input id="SortName" type="hidden" value="" />

    <div class="popup" id="winRss" style="display: none">
        <div class="rssMsg">
            <ul>
                <li>只有参赛用户才能订阅高手数据。</li>
            </ul>
            <p><a href="javascript:;" class="popup_unselect_B close">关闭</a><a onclick="ISTOCK_FUNC_GOTO_WDDS()" href="javascript:;" class="popup_unselect_A close">立即参赛</a></p>
        </div>
    </div>
    <div class="popup" id="winRssMax" style="display: none">
        <div class="rssMsg">
            <ul>
                <li>对不起，</li>
                <li>您已经订阅了 <strong>3</strong> 名高手！</li>
            </ul>
            <p><a href="javascript:;" class="popup_unselect_A close">确定</a></p>
        </div>
    </div>
    <div class="popup" id="winRssIsTrue" style="display: none">
        <div class="rssMsg">
            <ul>
                <li>您确定要订阅高手 <strong id="nickname_isture"></strong> 吗？</li>
                <li>订阅后次日生效，次日才能取消订阅！</li>
            </ul>
            <p><a href="javascript:;" class="popup_unselect_B close">取消</a><a onclick="InsertEmRss()" href="javascript:;" class="popup_unselect_A close">确定</a></p>
        </div>
    </div>
    <div class="popup" id="winRssSucc" style="display: none">
        <div class="rssMsg">
            <ul>
                <li>恭喜，您已成功订阅高手 <strong id="nickname"></strong></li>
                <li>该订阅将在次日生效</li>
                <li>您还可以订阅 <strong id="rsscount"></strong> 人</li>
            </ul>
            <p><a  href="javascript:;" class="popup_unselect_A close">确定</a></p>
        </div>
    </div>
    <div class="popup" id="winRssDel" style="display: none">
        <div>
            <ul>
                <li>您确定要取消订阅 <strong id="nickname_del"></strong> 的数据吗？</li>
                <li>重新订阅将要次日生效。</li>
            </ul>
            <p><a href="javascript:;" class="popup_unselect_B close">关闭</a><a onclick="DelEmRss()" href="javascript:;" class="popup_unselect_A close">确定</a></p>
        </div>
    </div>
    <div class="popup" id="winRssDelErr" style="display: none">
        <div>
            <ul>
                <li>取消失败，</li>
                <li>当日订阅的高手次日才能取消！</li>
            </ul>
            <p><a href="javascript:;" class="popup_unselect_A close">确定</a></p>
        </div>
    </div>

</body>
<script src="@SH.GetStaticFile("IStockClientStatic/js/EMWEBUIscrollBar.js")" type="text/javascript"></script>
<script src="@SH.GetStaticFile("IStockClientStatic/js/artDialog.js")" type="text/javascript"></script>
</html>
<script type="text/javascript">
    var www = "@(Url.Content("~/"))";
    var setWebView = null;

    $(function () {
        //////////////////////////// 数据初始化 开始//////////////////////////////////////////
        var time = 0;
        setWebView = function () {
            var topH0 = $(".tab_1").outerHeight() + $(".rank_ad").outerHeight(), winH = $(window).height(), winW = $(window).width();
            var myW = 825 + 120 + 120;
            RankTab(winW, myW);
        };

        //初始化滚动条
        $(".scrollBox").jscroll({ W: "7px", IW: "7px", CurrT: 0, Bar: { Pos: "up" }, Btn: { btn: false }, Fn: function () { } }).hover(function (e) {
            var thisbx = $(this), scrlbr = $(this).find(".jscroll-e");
            if (!scrlbr.hasClass("non")) {
                scrlbr.addClass("mon").stop(true, true, false).show();
            }
        }, function (e) {
            var thisbx = $(this), scrlbr = $(this).find(".jscroll-e");
            if (!scrlbr.hasClass("non")) {
                scrlbr.removeClass("mon");
                if (scrlbr.hasClass("vxdrag")) { } else {
                    //scrlbr.fadeOut("slow");
                }
            }
        });
        ReSetScroll();
        //加载总排行数据
        $.post(www + "QQ/rank_dp", { type: "daping" }, function (data) {
            $(".rank_k").html(data);
            ReSetScroll("#scrollBox1");
        })
        //加载高手操作
        $.post(www + "QQ/rank_gscz", {}, function (data) {
            $("#tabrss_lst").html(data);
            ReSetScroll("#scrollBox3");
        })
        //加载高手当日聚焦
        $.post(www + "QQ/rank_gsjj_day", {}, function (data) {
            $("#gsjj_day_lst").html(data);
            ReSetScroll("#scrollBox2");            
            ISTOCK_FUNC_QUOTES($("#hidStocks_gsjj_day").val());
        })
        //加载高手昨日聚焦
        $.post(www + "QQ/rank_gsjj_yesterday", {}, function (data) {
            $("#gsjj_yesterday_lst").html(data);
            ReSetScroll("#scrollBox2");

            ISTOCK_FUNC_QUOTES($("#hidStocks_gsjj_yesterday").val());
        })

        //////////////////////////// 数据初始化 结束//////////////////////////////////////////


        //关闭弹窗
        $(".close").click(function () {
            closetips();
        });
        //高手揭秘鼠标移上去弹出层
        $("#scrollBox4").delegate(".uncover_right_add", "mouseenter", "", function () {
            //判断是否是否已加入过自选
            var code = $(this).attr("code");
            if (is_add_zixuan(code)) {
                $(this).children("span").find('a').eq(0).html("-自选");          
            } else {
                $(this).children("span").find('a').eq(0).html("+自选");
            }

            $(this).children("span").show();
        }).delegate(".uncover_right_add", "mouseleave", "", function () {
            $(this).children("span").hide();
        });

        $("#gsjj_day_lst").delegate(".data_new_list", "mouseenter", "", function () {
            $(this).children(".data_new_prompt").show();
        }).delegate(".data_new_list", "mouseleave", "", function () {
            $(this).children(".data_new_prompt").hide();
        });
        $("#gsjj_yesterday_lst").delegate(".data_new_list", "mouseenter", "", function () {
            $(this).children(".data_new_prompt").show();
        }).delegate(".data_new_list", "mouseleave", "", function () {
            $(this).children(".data_new_prompt").hide();
        });

        ///////排名tab切换////////
        $(".tab_paiming").delegate("a", "click", function () {
            //清除保存的排序字段
            $("#SortName").val("");

            var str = '<div class="tc_loading">数据加载中...</div><div class="mask"></div>';
            var winH = $(window).height(), winW = $(window).width();
            var myW = 825 + 120 + 120;
            $self = $(this);
            $self.addClass("on").siblings().removeClass("on");
            var id = $self.attr("id");
            var hid_ranktype = $("#hid_ranktype").val();
            if (id == "rank") {
                if (hid_ranktype != "rank") {
                    $(".rank_k").html(str);
                    $("#hid_ranktype").val("rank");
                    RankTab(winW, myW);
                }
            } else if (id == "dayrank") {
                if (hid_ranktype != "dayrank") {
                    $(".rank_k").html(str);
                    $("#hid_ranktype").val("dayrank");
                    RankTab(winW, myW);
                }
            } else if (id == "weekrank") {
                if (hid_ranktype != "weekrank") {
                    $(".rank_k").html(str);
                    $("#hid_ranktype").val("weekrank");
                    RankTab(winW, myW);
                }
            }
            return false;
        });

        //////高手揭秘tab切换//////
        $(".uncover_right_title").delegate("li", "click", function () {
            $self = $(this);
            $self.addClass("uncover_right_A").siblings().removeClass("uncover_right_A");
            var id = $self.attr("id");
            if (id == "cclst") {
                $(".uncover_right_k").hide();
                $("#uncover_right_k_cclst").show();
            } else if (id == "jydetail") {

                $(".uncover_right_k").hide();
                $("#uncover_right_k_jydetail").show();
            }
        })

        ///////高手操作/我的订阅切换
        $(".tab_1_title").delegate("a", "click", function () {
            var str = '<div class="tc_loading" style="position: static; height: 170px; line-height: 160px; width: 100%; text-align: center;">数据加载中...</div><div class="mask"></div>';            
            var winH = $(window).height(), winW = $(window).width();
            var myW = 825 + 120 + 120;
            $self = $(this);
            $self.addClass("on").siblings().removeClass("on");
            var id = $self.attr("id");
            var hid_gscztype = $("#hid_gscztype").val();            
            if (id == "gscz") {
                if (hid_gscztype != "gscz") {
                    $("#tabrss_lst").html(str);
                    $("#hid_gscztype").val("gscz");
                    //高手操作
                    $.post(www + "QQ/rank_gscz", {}, function (data) {
                        $("#tabrss_lst").html(data);
                        ReSetScroll("#scrollBox3");
                    })
                }
            } else if (id == "wddy") {
                if (hid_gscztype != "wddy") {
                    $("#tabrss_lst").html(str);
                    $("#hid_gscztype").val("wddy");
                    //我的订阅
                    $.post(www + "QQ/rank_myrss", {}, function (data) {
                        if (data == "-1") {
                            $("#tabrss_lst").html('<div style="text-align:center;">点击<a style="text-decoration:underline" href="@(Url.Content("~/QQ?color="+ color))">绑定订阅</a></div>');
                        } else {
                            $("#tabrss_lst").html(data);
                        }
                        ReSetScroll("#scrollBox3");
                    })
                }
            }
        })
    });

    $(window).resize(function () {
        $(document).queue(function () {
            $(this).clearQueue();
            setWebView()
            $(this).dequeue();
        });
    });

  
    //排名列表选项卡切换
    function RankTab(winW, myW) {
        //判断是总收益 日收益 周收益状态
        var hid_ranktype = $("#hid_ranktype").val();
        if (hid_ranktype == "rank") {
            //总收益
            if (winW > myW) {
                $.post(www + "QQ/rank_dp", { type: "daping", SortFlag: $("#SortFlag").val(), SortName: $("#SortName").val() }, function (data) {
                    $(".rank_k").html(data);
                    ReSetScroll("#scrollBox1");
                })
            } else {
                $.post(www + "QQ/rank_dp", { type: "xiaoping", SortFlag: $("#SortFlag").val(), SortName: $("#SortName").val() }, function (data) {
                    $(".rank_k").html(data);
                    ReSetScroll("#scrollBox1");
                })
            }
        } else if (hid_ranktype == "dayrank") {
            //日收益
            if (winW > myW) {
                $.post(www + "QQ/rankday_dp", { type: "daping", SortFlag: $("#SortFlag").val(), SortName: $("#SortName").val() }, function (data) {
                    $(".rank_k").html(data);
                    ReSetScroll("#scrollBox1");
                })
            } else {
                $.post(www + "QQ/rankday_dp", { type: "xiaoping", SortFlag: $("#SortFlag").val(), SortName: $("#SortName").val() }, function (data) {
                    $(".rank_k").html(data);
                    ReSetScroll("#scrollBox1");
                })
            }
        } else if (hid_ranktype == "weekrank") {
            //周收益
            if (winW > myW) {
                $.post(www + "QQ/rankweek_dp", { type: "daping", SortFlag: $("#SortFlag").val(), SortName: $("#SortName").val() }, function (data) {
                    $(".rank_k").html(data);
                    ReSetScroll("#scrollBox1");
                })
            } else {
                $.post(www + "QQ/rankweek_dp", { type: "xiaoping", SortFlag: $("#SortFlag").val(), SortName: $("#SortName").val() }, function (data) {
                    $(".rank_k").html(data);
                    ReSetScroll("#scrollBox1");
                })
            }
        }
    }

    ///确认订阅
    function InsertEmRss()
    {
        var _ruid = $("#hid_ruid").val();
        var winH = $(window).height(), winW = $(window).width();
        var myW = 825 + 120 + 120;

        $.post(www + "QQ/PostAddEmRss", { ruid: _ruid }, function (data) {
            var datalst = data.split('|');            
            if (datalst[0] == "0") {
                RankTab(winW, myW);
                $("#rsscount").html(datalst[1])
                $("#nickname").html(datalst[2]);
                opentips("winRssSucc");
                if ($("#hid_gscztype").val() != "gscz") {
                    //更新我的订阅
                    $.post(www + "QQ/rank_myrss", {}, function (data) {
                        $("#tabrss_lst").html(data);
                        ReSetScroll("#scrollBox3");
                    })
                }
                return false;
            } else {
                opentips("winRss");
            }
        })
        return false;
    }
    ///添加订阅弹出层
    function AddEmRss(_ruid, e) {
        e = window.event || e;
        //判断用户是否为参赛用户
        $.post(www + "QQ/IsCanSaiUser", {}, function (data) {
            if (data == 1) {
                //是  在判断是否还可以订阅
                $.post(www + "QQ/IsDingYue", {}, function (data) {
                    if (data == 1) {
                        //订阅提示
                        $.post(www + "QQ/GetNickNameByQQ", { qq: _ruid }, function (data) {
                            $("#nickname_isture").html(data);
                        })
                        $("#hid_ruid").val(_ruid);
                        opentips("winRssIsTrue");

                        //订阅逻辑
                        //InsertEmRss(_ruid);
                    } else {
                        //提示用户不能订阅错误弹窗
                        opentips("winRssMax");
                    }
                })
            } else {
                //不是
                opentips("winRss");
            }
        });
        if (e && e.stopPropagation) { 
            e.stopPropagation();
        }
        else { 
            window.event.cancelBubble = true;
        }
         
    }
    ///取消订阅
    function DelEmRss() {
        var _ruid = $("#hid_ruid").val();
        var winH = $(window).height(), winW = $(window).width();
        var myW = 825 + 120 + 120;

        $.post(www + "QQ/PostDelEmRss", { ruid: _ruid }, function (data) {
            if (data == "0") {
                //更新我的订阅
                if ($("#hid_gscztype").val() != "gscz") {
                    $.post(www + "QQ/rank_myrss", {}, function (data) {
                        $("#tabrss_lst").html(data);
                        ReSetScroll("#scrollBox3");
                    })
                }
                //高手操作 和订阅 选项卡操作注意
                RankTab(winW, myW);
                return false;
            } else {
                opentips("winRssDelErr");                
                return false;
            }
        })
        return false;
    }

    ///取消我的订阅
    function DelMyEmRss(_ruid, e) {
        e = window.event || e;

        $("#hid_ruid").val(_ruid);
        $.post(www + "QQ/GetNickNameByQQ", { qq: _ruid }, function (data) {
            $("#nickname_del").html(data);
        })
        opentips("winRssDel");

        if (e && e.stopPropagation)
            e.stopPropagation();
        else {
            window.event.cancelBubble = true;
            return false;
        }
    }
    //高手揭秘
    function ShowGSJM(_qq) {
        var str = '<table id="rank_gsjm_list"  width="100%" border="0" cellspacing="0" cellpadding="0"> <tr><td colspan="9" style="text-align:center;">数据加载中...</td></tr></table>';
        $("#gsjmLst").html(str);
        //获取高手揭秘左侧信息
        $.post(www + "QQ/rank_gsjm_left", { qq: _qq}, function (data) {
            $("#uncover_left").html(data);
        })

        //获取高手揭秘持仓列表
        $.post(www + "QQ/rank_gsjm", { qq: _qq }, function (data) {
            $("#gsjmLst").html(data);
            ReSetScroll("#scrollBox4");
            ISTOCK_FUNC_QUOTES($("#hidStocks_jsjm").val());
            //ISTOCK_FUNC_QUOTES_CALLBACK();
        });
        //获取高手揭秘用户交易明细
        //$.post(www + "QQ/rank_gsjm_detail", { qq: _qq }, function (data) {
        //    $("#gsjmDetailLst").html(data);
        //    ReSetScroll("#scrollBox5");
        //})
        openWinTip("uncover");
    }
    
    //高手揭秘弹出层
    function opentips(name) {
        art.dialog({
            content: document.getElementById(name),
            id: name + 'div',
            padding: 0,
            title:"订阅提示",
            zIndex: 222222,
            top: '40%',
            lock: true,
            fixed: true,
            width: 346,
            height: 218,
            drag: false,
            resize:false
        });
        
    }
    //操作提示
    function openWinTip(name)
    {
        art.dialog({
            content: document.getElementById(name),
            id: name + 'div',
            padding: 0,           
            top: '30%',
            title: "高手揭秘",
            lock: true,
            width: 786,
            height: 356,
            zIndex: 222222,
            fixed: true,
            drag: true,
            resize: true
        });

        
    }
    //关闭弹出层
    function closetips() {
        var list = art.dialog.list;
        for (var i in list) {
            list[i].close();
        };
    }
    ///设置页面高度字适应
    function rize() {
        var hh = document.documentElement.clientHeight;
        var xx = hh - 16;
        $("body").css("height", hh);
        $(".main").css("height", (hh - 16));
        $(".main_left").css("height", (hh - 16));
        $(".main_right").css("height", (hh - 16));
        $(".rank_k").css("height", (xx - 100 - 26));
        //$(".rank_list").css("height",(xx*0.783));
        //$(".rank_ad").css("height",(xx*0.130));
        var data_box = xx - 381;
        $(".data_box").css("height", data_box);
        $("#scrollBox1").css("height", xx - 100 - 26 - 38);
        //$(".scrollBox").css("height", data_box);
        //$(".data_box02").css("height",data_box*0.52);
        //$(".tab_1_box").css("height",(data_box*0.356));
    }
    function add_zixuan(obj,code) {
        var opstate = $(obj).text();
        try {
            if (opstate == "+自选") {
                ISTOCK_add_zixuan(code);
            } else if (opstate == "-自选") {
                ISTOCK_del_zixuan(code);
            }
        } catch (e) {  }
        $("#rank_gsjm_list div[code=" + code + "]").children('span').hide();
    }
    
    //高手揭秘行情回调
    function ISTOCK_FUNC_QUOTES_CALLBACK(data) {
       
        //data = "{\"data\":[{\"code\":1000001,\"p\":\"13.72\",\"zdf\":\"0.44%\"},{\"code\":600600,\"p\":\"159.02\",\"zdf\":\"-0.62\"},{\"code\":1002340,\"p\":\"29.15\",\"zdf\":\"-0.44%\"},{\"code\":1002650,\"p\":\"29.15\",\"zdf\":\"-0.44%\"},{\"code\":600017,\"p\":\"29.15\",\"zdf\":\"-0.44%\"}],\"ver\":1}";
        //data = "{\"data\":[{\"code\":600679,\"p\":\"13.72\",\"zdf\":\"0.44%\"}],\"ver\":1}";
        if (data != undefined && data != "") {
            var obj = eval('(' + data + ')');
            if (obj != null && obj.data != null && obj.data.length > 0) {
               
                $.each(obj.data, function (i) {

                   
                    var code = obj.data[i].code;
                    if (code != undefined && code != "") {
                        code = code + "";
                        if (code.substring(0, 1) == "1") {
                            code = code.substring(1, code.length);
                        }
                       
                        ///////////////////（高手聚焦）///////////////////////////

                        //最新价
                        $("#gsjmLst tbody tr[code=" + code + "]").children('td').eq(3).html("<span class=" + colorcss(obj.data[i].zdf, 0) + ">" + obj.data[i].p + "</span>");
                        //涨跌幅
                        $("#gsjmLst tbody tr[code=" + code + "]").children('td').eq(4).html("<span class=" + colorcss(obj.data[i].zdf, 0) + ">" + obj.data[i].zdf + "</span>");
                        //持股数
                        var number = $("#gsjmLst tbody tr[code=" + code + "]").children('td').eq(5).html();
                        //成本价
                        var cost = $("#gsjmLst tbody tr[code=" + code + "]").children('td').eq(6).text();
                        ////alert(obj.data[i].p + " " + cost);
                        //$("#gsjmLst tbody tr[code=" + code + "]").children('td').eq(6).html("<span class=" + colorcss(obj.data[i].p, cost) + ">" + cost + "</span>");
                        //持仓市值
                        var ccsz = formatFloat(obj.data[i].p * parseInt(number));
                        $("#gsjmLst tbody tr[code=" + code + "]").children('td').eq(7).html(formatFloat(obj.data[i].p * parseInt(number)));
                        //浮动盈亏
                        //var fdyk = (formatFloat(obj.data[i].p) - formatFloat(cost)) * parseInt(number);
                        //$("#gsjmLst tbody tr[code=" + code + "]").children('td').eq(8).html("<span class=" + colorcss(fdyk, 0) + ">" + formatFloat(fdyk) + "</span>");
                        ////盈亏比
                        var ykb = (formatFloat(obj.data[i].p) - formatFloat(cost)) / formatFloat(cost) * 100;
                        $("#gsjmLst tbody tr[code=" + code + "]").children('td').eq(8).html("<span class=" + colorcss(ykb, 0) + ">" + formatFloat(ykb) + "</span>");


                        ///////////////////（当日聚焦）////////////////////////////////
                        $("#gsjj_day_lst div[code=" + code + "]").children('div').eq(1).html("<span class=" + colorcss(obj.data[i].zdf, 0) + ">" + obj.data[i].p + "</span>");
                        $("#gsjj_day_lst div[code=" + code + "]").children('div').eq(2).html("<span class=" + colorcss(obj.data[i].zdf, 0) + ">" + obj.data[i].zdf + "</span>");
                        ///////////////////（昨日聚焦）////////////////////////////////
                        $("#gsjj_yesterday_lst div[code=" + code + "]").children('div').eq(1).html("<span class=" + colorcss(obj.data[i].zdf, 0) + ">" + obj.data[i].p + "</span>");
                        $("#gsjj_yesterday_lst div[code=" + code + "]").children('div').eq(2).html("<span class=" + colorcss(obj.data[i].zdf, 0) + ">" + obj.data[i].zdf + "</span>");
                    }
                });
            }
        }
    }

    //客户端高手操作数据回调
    function ISTOCK_FUNC_SETMASTERHAND(data) {
        $.post(www + "qq/rank_gscz", function (data) {
            $("#tabrss_lst").html(data);
            ReSetScroll("#scrollBox3");
        })

        //var data = "[{\"msgid\":1021151726270,\"nick\":\"青出于蓝aa\",\"buysell\":\"模拟买入\",\"time\":\"2014-10-13\",\"code\":\"1002423\",\"name\":\"中原特钢\",\"num\":\"500\",\"price\":\"13.99\",\"flag\":\"0\",\"type\":\"腾讯炒股大赛\"}]";     
        //if (data != undefined && data != "") {
        //    var obj = eval('(' + data + ')');
        //    if (obj != null && obj.length > 0) {
        //        var str = '';

        //        str = '<div class="inf_part">';
        //        str += '<p class="grey_dark">' + obj[0].time + '   ' + obj[0].nick + '</p>';
        //        str += '<p><span class="red">' + obj[0].buysell + '</span> <span class="yellow">' + obj[0].name + '</span> 价格 ' + obj[0].price + ' 共 ' + obj[0].num + ' 股</p>';
        //        str += '</div>';
        //        $("#gscz_wujilu").remove();
        //        $("#tabrss_lst").prepend(str);
        //    }
        //}

    }

    //排序
    function Sort(col) {
        var saveCol = $("#SortName").val();
        var sortFlag = $("#SortFlag").val();
        if (saveCol == col) {
            if (sortFlag == "") {
                sortFlag = "desc";
            }
            else {
                sortFlag = "";
            }
        }
        else {
            sortFlag = "";
        }
        $("#SortFlag").val(sortFlag);
        $("#SortName").val(col);
        
        var winH = $(window).height(), winW = $(window).width();
        var myW = 825 + 120 + 120;
        RankTab(winW, myW);
        return false;
    };
</script>


